package org.jeecg.modules.bigdatashow.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.bigdatashow.entity.Station;

import java.util.List;

/**
 * @Description: 工位表
 * @Author: jeecg-boot
 * @Date:   2022-04-05
 * @Version: V1.0
 */
@Mapper
public interface StationMapper extends BaseMapper<Station> {

    @Select("SELECT line.`name` AS line_id,station.* FROM line,station WHERE line.id = station.`line_id` ")
    List<Station> list();

    @Select("SELECT line.`name` AS line_id,station.* FROM line,station WHERE line.id = station.`line_id` AND line_id= #{id}")
    List<Station> selectByLineId(String id);

    @Select("SELECT COUNT(line_id) FROM station WHERE line_id = #{line}")
    Integer count(String line);
}
